import $;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

<#--类路径-->
        package ${packageName}.controller;
        {packageName}.pojo.${metaData.className};
        {packageName}.service.${metaData.className}Service;
<#--导包-->
<#list metaData.importClassPaths as icp>
        {icp};
</#list>

/**
 * 注释: ${metaData.classComment} Controller
 * Table: ${metaData.classMetaData.tableName}表控制层
 *
 * @author: ${author}
 * @version: ${version}
 * @time: ${dateFormat2}
 */
@RestController
@RequestMapping("${metaData.className?uncap_first}")
public class ${metaData.className}Controller {
    /**
     * 服务对象
     */
    @Autowired
    private ${metaData.className}Service ${metaData.className?uncap_first}Service;

    /**
     * 通过主键查询单条数据
     *
<#list metaData.pk as pk>
     * @param ${pk.fieldName} 主键
</#list>
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public ${metaData.className} selectOne(<#list metaData.pk as pk>${pk.fieldType} ${pk.fieldName}<#if pk_has_next>,</#if></#list>) {
        return this.${metaData.className?uncap_first}Service.queryById(<#list metaData.pk as pk>${pk.fieldName}<#if pk_has_next>,</#if></#list>);
    }

}